Chris Pollett > Old Classes >
CS154

( Print View )

Student Corner:
  [Grades Sec3]

  [Submit Sec3]

  [Class Sign up Sec3]

  [
Lecture Notes]

  [Discussion Board]

  [Announcements]

Course Info:
  [Texts & Links]
  [Topics/Outcomes]
  [Outcomes Matrix]
  [Grading]
  [HW Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Additional Policies]

HW Assignments:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Hw5]

Practice Exams:
  [Mid1]  [Mid2]  [Final]

                           












CS154 Spring 2007Practice Midterm 1

To study for the midterm I would suggest you: (1) Know how to do (by heart) all the practice problems. (2) Go over your notes at least three times. Second and third time try to see how much you can remember from the first time. (3) Go over the homework problems. (4) Try to create your own problems similar to the ones I have given and solve them. (5) Skim the relevant sections from the book. (6) If you want to study in groups, at this point you are ready to quiz each other. The practice midterm is below. Here are some facts about the actual midterm: (a) It is closed book, closed notes. Nothing will be permitted on your desk except your pen (pencil) and test. (b) You should bring photo ID. (c) There will be more than one version of the test. Each version will be of comparable difficulty. (d) One problem (less typos) on the actual test will be from the practice test.

[Student Generated Solutions-PDF]

1. Give a context free grammar for the language consisting of strings over the symbols '(', ')' which are correctly parenthesized expressions.

2. Show the language of Problem 1 is not regular.

3. Construct DFAs for the following languages over {a,b}: (a) L1={w | na(w) = 1 mod 3}, (b) L2={w | na(w) = 3 mod 4}, and (c) L3={w | na(a) = 3 mod 12}. For (c), use the Cartesian product construction on (a) and (b).

4. Use the construction from class to get a regular expression for 3 (a). Show the steps involved.

5. Show step by step how to construct a NFA for the regular expression (ab)*∪(ba)*.

6. Consider the NFA:

Picture of an NFA

Show step by step how to convert it to an equivalent DFA.

7. Do state minimization on the DFA you got in 6.

8. Prove the regular languages are closed under quotient.

9. Using the fact that {0n1n | n≥0} is not regular and the fact that the regular languages are closed under homomorphism to show that {0n1m2n-m | n ≥ m≥ 0}is not regular.

10. Prove the Context Free Languages are closed under union.